﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="takestore.aspx.cs" Inherits="dzs.Web.Admin.inventory.takestore" %>
<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
     <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#<%# txtproject.ClientID%>").autocomplete({
                 minLength: 2, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { value: item };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
       <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
                <tr>
                    <td align="left" >
                         <b>物料名称：</b>
                    <asp:TextBox ID="txtname" runat="server"></asp:TextBox>
                        <b>项目名称：</b>
                         <asp:TextBox ID="txtproject" runat="server"></asp:TextBox>
                    <asp:Button ID="btnSearch" runat="server" Text="查询"  OnClick="btnSearch_Click" >
                    </asp:Button>                    
                        
                    </td>
                    <td class="tdbg">
                    </td>
                </tr>
            <tr>
                   
                    <td style="text-align:left;" colspan="2" >   
            <asp:GridView ID="gridView" runat="server"  Width="100%" 
                    BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None" OnRowDataBound="gridView_RowDataBound"
                    AutoGenerateColumns="False"  RowStyle-HorizontalAlign="Center" OnRowCreated="gridView_OnRowCreated" PageSize="15" DataKeyNames="inid" OnRowCommand="gridView_RowCommand" >
                    <Columns>
                            
		                <asp:TemplateField HeaderText="修改库存">
                            <ItemTemplate>
                                <asp:TextBox ID="txtnum" runat="server" Text='<%# Eval("nums") %>' Width="50px"></asp:TextBox>
                                <asp:Button ID="btnset" runat="server" CommandName="myset" Text="确定" />
                            </ItemTemplate>
                            <ItemStyle Width="150px" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="proid" HeaderText="项目编号" />
                        <asp:BoundField DataField="projectname" HeaderText="项目名称" />
                        <asp:BoundField DataField="projecttype" HeaderText="项目类型" />
                        <asp:BoundField DataField="material" HeaderText="物料名称" />
                        <asp:BoundField DataField="nums" HeaderText="数量" />
                        <asp:BoundField DataField="unitPrice" HeaderText="单价" />
                        <asp:BoundField DataField="usework" HeaderText="需用单位" />
                            
		<asp:BoundField DataField="spname" HeaderText="仓位" SortExpression="mid" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="sptname" HeaderText="仓位类型" SortExpression="spid" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="sname" HeaderText="仓库" SortExpression="nums" ItemStyle-HorizontalAlign="Center"  > 
                            
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="status" HeaderText="仓位状态" />
                        </Columns>
                <PagerStyle CssClass="mypager" />
<RowStyle HorizontalAlign="Center"></RowStyle>
                </asp:GridView>
              </td>
                </tr>
                           
                <tr>
                   
                    <td style="text-align:left;" colspan="2" >   
                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" CurrentPageButtonPosition="Center"
                            PageSize="20" AlwaysShowFirstLastPageNumber="True" CustomInfoTextAlign="Left"
                    FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" NumericButtonCount="10"
                    PrevPageText="上一页" CssClass="paginator" CurrentPageButtonClass="" CustomInfoHTML="第 %CurrentPageIndex% 页|共 %PageCount% 页,%RecordCount%条记录 "
                    LayoutType="Table" ShowCustomInfoSection="Left" ShowNavigationToolTip="True"
                    ShowPageIndexBox="Always" PageIndexBoxType="DropDownList" TextAfterPageIndexBox="页"
                    TextBeforePageIndexBox="转到第" onpagechanged="AspNetPager1_PageChanged">
                </webdiyer:AspNetPager>

                    </td>
                </tr>
                           
                <tr>
                    
                    <td align="left">
                        <asp:Button ID="btnout" runat="server" OnClick="btnout_Click" Text="导出" />
                    </td>
                    <td style="">                        
                    </td>
                </tr>
            </table>
</asp:Content>
